<?php

namespace apiend\modules\dynamic\controllers;

use Yii;
use apiend\components\Controller;

/**
 * 短视频列表
 * Default controller for the `dynamic` module
 */
class VideoController extends Controller {

    public $modelClass = 'api\modules\dynamic\models\DynamicVideoSearch';

    /**
     * {@inheritdoc}
     */
    public function actions() {
        return [
            'view' => [
                'class' => 'yii\rest\ViewAction',
                'modelClass' => $this->modelClass,
            ],
        ];
    }

    /**
     * @inheritdoc
     */
    public function actionIndex() {
        /* @var $modelClass \api\modules\dynamic\models\DynamicVideoSearch */
        $modelClass = new $this->modelClass;
        return $modelClass->search();
    }

}
